/**
 * 
 */
package com.lanswon.qzsmk.util;


import java.text.ParseException;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;



 
/**
 * 
 * @author 鱼洲杰
 *
 */
@Component
public class ReadproUtil {
	
	public static final String separator="/";
	
	public static String INCOMING_PATH;
	
	public static String INCOMING_FILE_SUFFIX;
	
	public static String RESPONSESUCCESS_PATH;
	
	public static String BLANK_REJECT_TASK_PATH;
	
	public static String BLANK_REJECT_TASK_RECEIVED_PATH;
	
	public static String REJECT_DISTRIBUTETASK_PATH;
	
	public static String REJECT_DISTRIBUTSUCCESS_PATH;
	
    public static String CREDENCIAL_PATH;
	
	public static String IP_ADDRESS;
	

	/**
     * 读取properties文件
     *
     * @param 
	 * @throws 
     */
	/*public static  Map<String,Object> readPro() { 
	        Properties prop = new Properties();  
	        Map<String,Object> map=new HashMap<String,Object>();
		             //读取属性文件properties
	                InputStream in = ReadproUtil.class.getClassLoader().getResourceAsStream("conf/inventoryFilePath.properties");
		            try {
						prop.load(in);
					} catch (IOException e) {
						e.printStackTrace();
						 String msg1="IO流异常";
		 					logger.error(msg1);
		 					throw new SystemException(SystemException.IOException, msg1);

					}     ///加载属性列表
		            Iterator<String> it=prop.stringPropertyNames().iterator();
		            
		            while(it.hasNext()){
	                 String key=it.next();
	     			String value =prop.getProperty(key);
		            System.out.println(key+":"+prop.getProperty(key));
		    		map.put(key,value);
		           }
		            try {
						in.close();
					} catch (IOException e) {
						e.printStackTrace();
						 String msg1="IO流关闭异常";
		 					logger.error(msg1);
		 					throw new SystemException(SystemException.IOException, msg1);

					}
		            ///保存属性到b.properties文件
		           
		        
		        return map;
		     } */
	@Value("#{inventorypathConfig['INCOMING_PATH']}")
	public void setINCOMING_PATH(String INCOMING_PATH) {
		ReadproUtil.INCOMING_PATH = INCOMING_PATH;
	}
	
	@Value("#{inventorypathConfig['INCOMING_FILE_SUFFIX']}")
	public void setINCOMING_FILE_SUFFIX(String INCOMING_FILE_SUFFIX) {
		ReadproUtil.INCOMING_FILE_SUFFIX = INCOMING_FILE_SUFFIX;
	}
	
	@Value("#{inventorypathConfig['RESPONSESUCCESS_PATH']}")
	public void setRESPONSESUCCESS_PATH(String RESPONSESUCCESS_PATH) {
		ReadproUtil.RESPONSESUCCESS_PATH = RESPONSESUCCESS_PATH;
	}
	
	@Value("#{inventorypathConfig['BLANK_REJECT_TASK_PATH']}")
	public void setBLANK_REJECT_TASK_PATH(String BLANK_REJECT_TASK_PATH) {
		ReadproUtil.BLANK_REJECT_TASK_PATH = BLANK_REJECT_TASK_PATH;
	}
	
	@Value("#{inventorypathConfig['BLANK_REJECT_TASK_RECEIVED_PATH']}")
	public void setBLANK_REJECT_TASK_RECEIVED_PATH(String BLANK_REJECT_TASK_RECEIVED_PATH) {
		ReadproUtil.BLANK_REJECT_TASK_RECEIVED_PATH = BLANK_REJECT_TASK_RECEIVED_PATH;
	}
	
	@Value("#{inventorypathConfig['REJECT_DISTRIBUTETASK_PATH']}")
	public void setREJECT_DISTRIBUTETASK_PATH(String REJECT_DISTRIBUTETASK_PATH) {
		ReadproUtil.REJECT_DISTRIBUTETASK_PATH = REJECT_DISTRIBUTETASK_PATH;
	}
	
	@Value("#{inventorypathConfig['REJECT_DISTRIBUTSUCCESS_PATH']}")
	public void setREJECT_DISTRIBUTSUCCESS_PATH(String REJECT_DISTRIBUTSUCCESS_PATH) {
		ReadproUtil.REJECT_DISTRIBUTSUCCESS_PATH = REJECT_DISTRIBUTSUCCESS_PATH;
	}
	
	@Value("#{inventorypathConfig['CREDENCIAL_PATH']}")
	public void setCREDENCIAL_PATH(String CREDENCIAL_PATH) {
		ReadproUtil.CREDENCIAL_PATH = CREDENCIAL_PATH;
	}
	
	@Value("#{inventorypathConfig['IP_ADDRESS']}")
	public void setIP_ADDRESS(String IP_ADDRESS) {
		ReadproUtil.IP_ADDRESS = IP_ADDRESS;
	}
	
	public static void main(String[] args) throws ParseException {
		System.out.println(ReadproUtil.INCOMING_PATH);
		
	}
}
